/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */
typedef struct ListNode ListNode;
struct ListNode* deleteDuplicates(struct ListNode* head)
{
    if (!head)
        return head;
    bool check[250] = { 0 };
    check[head->val + 100] = true;
    ListNode* pcur = head->next, * pre = head;
    while (pcur)
    {
        if (check[pcur->val + 100])
        {
            pre->next = pcur->next;
        }
        else
        {
            pre = pcur;
            check[pcur->val + 100] = true;
        }
        pcur = pcur->next;
    }
    return head;
}